package com.tyrone.captcha.entity;

import com.tyrone.captcha.entity.constant.ResponseCode;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author xieyl
 * @create 2021/10/27 17:11
 */
@Data
@AllArgsConstructor
public class Response {
    private Integer code;
    private Object data;
    private String msg;


    public Response(ResponseCode responseCode, String msg) {
        this.code = responseCode.getCode();
        this.msg = msg;
    }

    public Response(ResponseCode responseCode, Object data) {
        this.code = responseCode.getCode();
        this.data = data;
        this.msg = responseCode.getMsg();
    }

    public Response(ResponseCode responseCode, Object data, String msg) {
        this.code = responseCode.getCode();
        this.data = data;
        this.msg = msg;
    }

}
